<?php
include_once "PDO.class.php";
$mysql = new Db();
$id=$_GET['id'];
$query = $mysql->upd('works',$id);
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<form action="do_upd.php" method="get">
    <table>
        <?php foreach ($query as $k=>$v) {?>
            <tr>
                <p>ID:<?php echo $v['id']?></p>
            </tr>
            <tr>
                <td>职位</td>
                <td>
                    <input type="text" name="work" value="<?php echo $v['work']?>">
                </td>
            </tr>
            <tr>
                <td>地址</td>
                <td>
                    <input type="text" name="address" value="<?php echo $v['address']?>">
                </td>
            </tr>
            <tr>
                <td>薪资</td>
                <td>
                    <input type="text" name="money" value="<?php echo $v['money']?>">
                </td>
            </tr>
            <tr>
                <td>公司</td>
                <td>
                    <input type="text" name="job" value="<?php echo $v['job']?>">
                </td>
                <td>
                    <input type="hidden" name="id" value="<?php echo $v['id']?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="submit" value="修改">
                </td>
            </tr>
        <?php }?>
    </table>
</form>
</body>
</html>
